package com.ruoyi.recycleshop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.recycleshop.domain.ShopExchangeRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;

public interface ShopExchangeRecordMapper extends BaseMapper<ShopExchangeRecord> {

    @Select("select sum(amount) FROM shop_exchange_record where shop_id = ${shopId} and create_time like \"%${date}%\"")
    BigDecimal sumAmountByTime(@Param("shopId") Long shopId, @Param("date") String date);
}
